<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;

class TestModel extends Model
{
    protected $autoWriteTimestamp = true;//自动写入时间戳
    protected $pk = 'id';//主键，可以用get查询
    //软删除
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = null;

    //富文本转换
    public function getPostContentAttr($value){
        return cmf_replace_content_file_url(htmlspecialchars_decode($value));
    }

    //富文本设置
    public function setPostContentAttr($value){
        return htmlspecialchars(cmf_replace_content_file_url(htmlspecialchars_decode($value), true));
    }
    
}